import java.util.Map;

public class FastEntry<K, V> implements Map.Entry<K, V> {
	K key;
	V value;
	FastEntry<K, V> next;

	protected FastEntry(int hash, K key, V value) {
		this.key = key;
		this.value = value;
	}

	public K getKey() {
		return key;
	}

	public V getValue() {
		return value;
	}

	public V setValue(V value) {
		if (value == null)
			throw new NullPointerException();

		V oldValue = this.value;
		this.value = value;
		return oldValue;
	}

	public boolean equals(Object o) {
		if (!(o instanceof Map.Entry))
			return false;
		Map.Entry<?, ?> e = (Map.Entry) o;

		return key.equals(e.getKey()) && value.equals(e.getValue());
	}

	public String toString() {
		return key.toString() + "=" + value.toString();
	}
}
